<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

namespace App\Controller;

use App\Service\Third\OppoAdService;
use App\Service\Third\SMVideoCallCallbackService;
use Hyperf\HttpServer\Annotation\Middleware;
use App\Service\Third\AgoraCallbackService;
use App\Service\Third\AliPayCallbackService;
use App\Service\Third\ApplePayCallbackService;
use App\Service\Third\RongCallbackService;
use App\Service\Third\RongOnlineStatusService;
use App\Service\Third\WechatPayCallbackService;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Hyperf\HttpServer\Annotation\Controller;
use App\Middleware\JTAuthMiddleware;
use App\Service\Third\GiteeCallbackService;
use App\Service\Third\RongCheckmsgService;
use App\Service\Third\SandPayCallbackService;
use App\Service\Third\YunZhCallbackService;
use App\Service\Third\RongDetectionEffectService;
use App\Service\Third\BaiduAdService;
use App\Service\Third\BaiduExtraAccountService;
/**
 * @Controller(prefix="callback")
 */
class ThirdController extends AbstractController
{
    /**
     * 声网回调
     * @RequestMapping(path="agora", methods="post")
     */
    public function agora(AgoraCallbackService $service)
    {
        return $service->response();
    }

    /**
     * 融云消息回调
     * @RequestMapping(path="rongcloud/msg", methods="post")
     */
    public function rongcloud_im(RongCallbackService $service)
    {
        return $service->response();
    }

    /**
     * 融云消息回调-消息检测
     * @RequestMapping(path="rongcloud/checkmsg", methods="post")
     */
    public function rongcloud_checkmsg(RongCheckmsgService $service)
    {
        return $service->response();
    }

    /**
     * 融云在线状态回调
     * @RequestMapping(path="rongcloud/online", methods="post")
     */
    public function rongcloud_online(RongOnlineStatusService $service)
    {
        return $service->response();
    }

    /**
     * 支付宝回调
     * @RequestMapping(path="alipay", methods="post")
     */
    public function alipay(AliPayCallbackService $service)
    {
        return $service->response();
    }

    /**
     * 微信支付回调
     * @RequestMapping(path="wechat_pay", methods="post")
     */
    public function wechat_pay(WechatPayCallbackService $service)
    {
        return $service->response();
    }

    /**
     * 杉德支付回调
     * @RequestMapping(path="sand_pay", methods="post")
     */
    public function sand_pay(SandPayCallbackService $service)
    {
        return $service->response();
    }

    /**
     * 苹果内购回调
     * @RequestMapping(path="apple_pay", methods="post")
     * @Middleware(JTAuthMiddleware::class)
     */
    public function apple_pay(ApplePayCallbackService $service)
    {
        return $service->response();
    }

    /**
     * 云账户下单回调
     * @RequestMapping(path="yzh_order", methods="post")
     */
    public function yzh_order(YunZhCallbackService $service)
    {
        $service->response();
        return 'success';
    }

    /**
     * Gitee回调
     * @RequestMapping(path="gitee", methods="post")
     */
    public function gitee(GiteeCallbackService $service)
    {
        $service->response();
        return 'success';
    }

    /**
     * 融云内容检测结果回调
     * @RequestMapping(path="detection/checkmsg", methods="post")
     */
    public function detection_checkmsg(RongDetectionEffectService $service)
    {
        return $service->response();
        return 'success';
    }

    /**
     *  百度回传
     *  @RequestMapping(path="baidu_ad", methods="get,post")
     */
    public function baidu_ad(BaiduAdService $service)
    {
        return $service->response();
        return 'success';
    }

    /**
     *  百度回传
     *  @RequestMapping(path="baidu_extra_account", methods="get,post")
     */
    public function baidu_extra_account(BaiduExtraAccountService $service)
    {
        return $service->response();
        return 'success';
    }

    /**
     * 数美视频检测回调
     * @RequestMapping(path="sm_video_call_callback", methods="post")
     */
    public function sm_video_call_callback(SMVideoCallCallbackService $service)
    {
        return $service->response();
    }

    /**
     * oppo点击回传
     * @RequestMapping(path="oppo_ad", methods="get")
     */
    public function oppo_ad(OppoAdService $service)
    {
        return $service->response();
    }
}
